package com.ymatou.iapi.godmch.service;

import java.util.ArrayList;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ymatou.iapi.godmch.parameter.AgentDetailInfo;
import com.ymatou.iapi.godmch.parameter.AgentInfo;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*查看代理商列表Call
*FreeMaker Template自动生成代码
*/
public class detailagentCall extends YmatouBaseCall{
	private static String opurl ="api/agent/detail";
	
	public detailagentCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public AgentDetailInfo getResult() {
		AgentDetailInfo result =null;
		try {
			result = (AgentDetailInfo) new Gson().fromJson(getJsonObject().get("result").toString(), new TypeToken<AgentDetailInfo>() {}.getType());
		} catch (Exception e) {
			//没获取到就是null
//			e.printStackTrace();
		}
		return result;
	}
}